package bu.met.cs664;

import java.util.Scanner;

public class HumanPlayer extends Player {
	Scanner in;

	public HumanPlayer(int id) {
		super(id);
		in = new Scanner(System.in);
	}

	public int nextMove(Board board) {
		while (true) {

			System.out.println("What is your next move?");
			String input = in.nextLine();
			if (input.length() > 0) {
				int nextMove = Character.getNumericValue(input.charAt(0));

				if (board.isValid(nextMove) && board.isAvailable(nextMove)) {
					return nextMove;
				}
			}

		}
	}

}
